<?
$email = 'sdgsd@sdgsdf.io';

function validate_email($email) {

	if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { 
		echo "not valid ".$email;
	}else{
		echo "valid ";
	}

}
validate_email($email);	
?>